<?php
	
	require_once('../inc/fen_fns.php');
	
	sec_session_start();
	
	$user_id = $_POST['user_id'];
	$titr = $_POST['titr'];
	$name = $_POST['name'];
	$surname = $_POST['surname'];
	$email = $_POST['email'];
	$faculty_id = $_POST['faculty_id'];
	$department_id = $_POST['department_id'];
	$access_level = $_POST['access_level'];
	$status = $_POST['status'];
	
	if(login_check($mysqli, '>', '100') == true) {
	
		$query = $_DB->Query("update fen_members set
							faculty_id = '$faculty_id',
							department_id = '$department_id',
							status = '$status',
							access_level = '$access_level',
							titr = '$titr',
							name = '$name',
							surname = '$surname',
							email = '$email'
							WHERE
							id = '$user_id'
						 	");
		header('Location: ../users.php');
	
	} else {
		header('Location: ./index.php?error=2');
	}
	
	